using System;
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;

public class TitleScreenUIHandler : MonoBehaviour
{
    [SerializeField] private HowToPlayDialog howToPlayDialog;
    [SerializeField] private SettingsDialog settingsDialog;

    public void StartGame()
    {
        SceneManager.LoadScene(1);
    }

    public void OpenHowToPlay()
    {
        DialogBase dialog = Instantiate(howToPlayDialog);
        dialog.OpenDialog();
    }
    
    public void OpenSettings()
    {
        DialogBase dialog = Instantiate(settingsDialog);
        dialog.OpenDialog();
    }
    
    public void Exit()
    {
#if UNITY_EDITOR
        EditorApplication.ExitPlaymode();
#else
        Application.Quit();
#endif
    }
}
